package com.xixiake.net.record;

import com.android.volley.Request;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.xixiake.net.BaseInput;
import com.xixiake.net.InputKey;

/**
 * 登录接口
 * Created by c-wanghengli on 2017/5/13.
 */
public class LoginRecord {

    public static class Input extends BaseInput<LoginRecord>{

        protected Input() {
            super("?c=Auth&a=api_login",Request.Method.POST,LoginRecord.class);
        }

        @InputKey(name = "phoneno")
        private String phoneno;

        @InputKey(name = "passwd")
        private String passwd;

        @InputKey(name = "client")
        private String client = "3";

        public static BaseInput<LoginRecord> buildInput(String phoneno,String passwd){
            Input input = new Input();
            input.phoneno = phoneno;
            input.passwd = passwd;
            return input;
        }
    }

    @Expose
    @SerializedName(value = "errorCode")
    public int errorCode;

    @Expose
    @SerializedName(value = "errorMsg")
    public String errorMsg;

    @Expose
    @SerializedName(value = "data")
    public Data data = new Data();

    public static class Data{

        @Expose
        @SerializedName(value = "userid")
        public int userid;

        @Expose
        @SerializedName(value = "accesstoken")
        public String accesstoken;

        @Expose
        @SerializedName(value = "expires")
        public Long expires;

        @Expose
        @SerializedName(value = "refreshtoken")
        public String refreshtoken;

        @Expose
        @SerializedName(value = "type")
        public String type;

        @Expose
        @SerializedName(value = "client")
        public String client;

    }


}
